package com.carryon.modules.sj;

import com.carryon.lang.MapJ;
import com.carryon.modules.json.Json;

/**
 * @author Helin
 * @mail hl_0074@sina.com
 * @date 2011-9-26
 * 
 */
public class Response extends MapJ {

	private static final long serialVersionUID = -6032314676050050612L;

	private int status = 200;
	private String message = "";

	public Response() {

	}

	public int status() {

		return status;
	}

	public void status(int status) {

		this.status = status;
	}

	public String message() {

		return message;
	}

	public void message(String message) {

		this.message = message;
	}

	@Override
	public String toJSON() {

		StringBuffer json = new StringBuffer();
		json.append("{");
		json.append("\"status\":" + this.status);
		json.append(",\"message\":\"" + this.message + "\"");
		json.append(",data:" + Json.toJson(this));
		json.append("}");
		return json.toString();

	}

}
